<template>
    <div>
        {{form.name}}
        {{count}}
        <button @click="change">点击</button>
    </div>
</template>

<script>
// import { ref } from '@vue/reactivity'
import {reactive,ref,onMounted} from 'vue'
import maxios from '../http/axios'
export default {
      setup() {
          let form = reactive({'name':'123','password':'sdf'})
          let count = ref(0)
          const change=()=>{
              form.name = 'abc'
              count.value = 12
              maxios('test','get').then(res => {
                console.log(res)
            })
          }
          //钩子函数
          onMounted(() => {
              change()
          })
          return{
              form,
              count,
              change
          }
      }
}
</script>

<style scoped>

</style>
